home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / Warp3D / Install_Warp3D < prev    next >
Encoding:
Text File  |  2000-02-17  |  10.5 KB  |  439 lines

  1. ; $VER: Installation script for Warp3D 1.0 ( 5. Dezember 1998)
  2. ; © Thomas & Hans-Jörg Frieden
  3. ; Created with GoldED 5.0
  4. ; Adapted for V2 beta, 04-Feb-99
  5. ; check if we are running under correct OS
  6.  
  7. (set #version (/ @installer-version 65536))
  8.  
  9. (if (< (/ (getversion) 65536) 39)
  10.     (
  11.         (abort "Incorrect OS version (software requires OS 39 or better )!")
  12.     )
  13. )
  14.  
  15. ; error handling
  16.  
  17. ;
  18. ; Procedure to copy a single library
  19. (procedure P_copy_single arg1 arg2 arg3
  20.         (copylib
  21.                 (confirm)
  22.                 (prompt arg3)
  23.                 (help @copylib-help)
  24.                 (source arg1)
  25.                 (dest arg2)
  26.                 (optional "oknodelete" "askuser")
  27.         )
  28. )
  29.  
  30. ;
  31. ; How can it be there's no way of specifying an environment variable?
  32. (procedure P_setenv arg1 arg2
  33.         (
  34.                 (if (exists (tackon "ENV:" arg1) (noreq))
  35.                         (delete (tackon "ENV:" arg1))
  36.                 )
  37.                 (if (exists (tackon "ENVARC:" arg1) (noreq))
  38.                         (delete (tackon "ENVARC:" arg1))
  39.                 )
  40.                 (textfile
  41.                         (dest (tackon "ENV:" arg1))
  42.                         (append arg2)
  43.                 )
  44.                 (textfile
  45.                         (dest (tackon "ENVARC:" arg1))
  46.                         (append arg2)
  47.                 )
  48.         )
  49. )
  50.  
  51. ;
  52. ; Procedure to invalidate old version
  53. (procedure P_invalidate
  54.     (if (exists "libs:Warp3D" (noreq))
  55.       ( if (< (getversion "libs:Warp3D.library") 196608)
  56.         (
  57.         (message (cat "The installer will now invalidate your old installation by moving "
  58.                       "old files to a directory old_warp3d. Note that the old libraries "
  59.                       "are no longer compatible with V2")
  60.         )
  61.         ; make backup directory
  62.         (makedir "libs:old_warp3d")
  63.         (makedir "libs:old_warp3d/Warp3D")
  64.  
  65.         ; copy old stuff
  66.         (copyfiles
  67.             (source "Libs:Warp3D")
  68.             (dest "Libs:old_warp3d/Warp3D")
  69.             (infos)
  70.             (all)
  71.             (optional "nofail" "force" "askuser")
  72.         )
  73.         (copyfiles
  74.             (source "Libs:Warp3D.library")
  75.             (dest "Libs:old_warp3d")
  76.             (infos)
  77.             (all)
  78.             (optional "nofail" "force" "askuser")
  79.         )
  80.         (copyfiles
  81.             (source "Libs:Warp3DPPC.library")
  82.             (dest "Libs:old_warp3d")
  83.             (infos)
  84.             (all)
  85.             (optional "nofail" "force" "askuser")
  86.         )
  87.  
  88.         ; delete old files
  89.         (delete "libs:Warp3D.library" (optional "force"))
  90.         (delete "libs:Warp3DPPC.library" (optional "force"))
  91.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  92.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  93.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  94.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  95.         (delete "libs:Warp3D/" (optional "force"))
  96.  
  97.         (message (cat "The old libraries can now be found in libs:old_warp3d."
  98.                       "If you experience any problem with V2, you may uninstall it "
  99.                       "and use the old_warp3d files again. Otherwise, you may delete "
  100.                       "the old_warp3d directory")
  101.         )
  102.       )
  103.     )
  104.     )
  105. )
  106.  
  107.  
  108. (if (>= #version 44)
  109.     (
  110.         (effect "center" "radial" $ffffff $ffffff)
  111.         (showmedia "w3d" "Installer_Media/Warp3D.jpg" "upper_left" "none" 0)
  112.         (showmedia "3dw" "Installer_Media/3DWorld.jpg" "upper_right" "none" 0)
  113.     )
  114. )
  115.  
  116.  
  117. (onerror
  118.     (if (> @ioerr 0)
  119.         (
  120.             (message
  121.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  122.             )
  123.         )
  124.     )
  125.     (exit (quiet))
  126. )
  127.  
  128. (set #installmode
  129.     (askbool
  130.         (prompt (cat
  131.             "Welcome to Warp3D.\n"
  132.             "Choose the installation mode.\n\n"
  133.             "If you have an older version of Warp3D installed, "
  134.             "you may want to choose uninstall now to avoid confusion with older drivers."
  135.             )
  136.         )
  137.         (help "Select Install if you want to install Warp3D, and Uninstall if you want to remove it. Warp3D is a hardware independent driver system for 3d accelerators.")
  138.         (choices
  139.             "Install"
  140.             "Uninstall"
  141.         )
  142.         (default 1)
  143.     )
  144. )
  145.  
  146. (if (= #installmode 1)
  147.     ; normal installation
  148.     (
  149.         (welcome (cat
  150.             "Welcome to the Warp3D installation. This utility will install or "
  151.             "update Warp3D, the hardware-independent 3D driver system, on your "
  152.             "Amiga. ")
  153.         )
  154.         (P_invalidate)
  155.  
  156.         (message "The Installation program will now create a new directory \"Warp3D\" in your LIBS directory where the Warp3D libraries will be installed.")
  157.         (makedir "Libs:Warp3D/")
  158.         (makedir "Libs:Warp3D/GFXdrivers")
  159.         (makedir "Libs:Warp3D/HWdrivers")
  160.         ; --- Try to find out if WarpUp is installed.
  161.         (if (exists "libs:Warp.library" (noreq))
  162.             (set #ppc 1)
  163.             (set #pcc 0)
  164.         )
  165.         (if (= #ppc 1)
  166.             (set #result
  167.                 (askbool
  168.                     (prompt "You seem to have WarpUp installed. Warp3D comes with a special PPC version that is usable for WarpUp applications. Do you want to install the PPC libraries, too?")
  169.                     (help @askbool-help)
  170.                     (choices "Yes" "No")
  171.                     (default 1)
  172.                 )
  173.             )
  174.             (if (= #result 0)
  175.                 (set #ppc 0)
  176.             )
  177.         )
  178.         (copylib
  179.             (prompt "Copying the master library")
  180.             (help @copylib-help)
  181.             (source "libs/Warp3D.library")
  182.             (dest "libs:")
  183.         )
  184.         (if (= #ppc 1)
  185.             (copylib
  186.                 (prompt "Copying the PPC master library")
  187.                 (help @copylib-help)
  188.                 (source "libs/Warp3DPPC.library")
  189.                 (dest "libs:")
  190.             )
  191.         )
  192.  
  193.         ; ask for graphics driver
  194.         (set #gfx_sys
  195.             (askoptions
  196.                 (prompt "Which graphics systems do you want to use with Warp3D ?")
  197.                 (help @askoptions-help)
  198.                 (choices
  199.                     "CyberGraphX V3/V4"
  200.                     "Picasso96"
  201.                 )
  202.                 (default (+ 1 2))
  203.             )
  204.         )
  205.  
  206.         ; if P96 is selected, install it
  207.         (if (BITAND #gfx_sys 2)
  208.          (
  209.             (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96.library"
  210.                            "libs:Warp3D/GFXdrivers"
  211.                            "Copy Picasso96 driver"
  212.             )
  213.             (if (= #ppc 1)
  214.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96_PPC.library"
  215.                                "libs:Warp3D/GFXdrivers"
  216.                                "Copy Picasso96 driver (PPC version)"
  217.                 )
  218.             )
  219.          )
  220.         )
  221.  
  222.         ; same for CGX, but ask for version first
  223.         (if (BITAND #gfx_sys 1)
  224.         (
  225.             (set #result
  226.                 (askchoice
  227.                     (prompt "What version of CyberGraphX do you have installed ?\n")
  228.                     (help @askchoice-help)
  229.                     (choices
  230.                         "CyberGraphX V3 (for CyberVision3D)"
  231.                         "CyberGraphX V3 (for CVPPC/BVPPC)"
  232.                         "CyberGraphX V4"
  233.                     )
  234.                     (default 2)
  235.                 )
  236.             )
  237.             ; assume the V4 driver will be installed, except when CVision3D is selected
  238.             (set #version 1)
  239.             (if (= #result 0)
  240.                 (set #version 0)
  241.             )
  242.  
  243.             (if (= #version 0)
  244.             (
  245.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX.library"
  246.                                "libs:Warp3D/GFXdrivers"
  247.                                "Copy CyberGraphX V3 driver"
  248.                 )
  249.                 (if (= #ppc 1)
  250.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX_PPC.library"
  251.                                    "libs:Warp3D/GFXdrivers"
  252.                                    "Copy CyberGraphX V3 driver (PPC version)"
  253.                     )
  254.                 )
  255.              )
  256.              (
  257.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4.library"
  258.                                "libs:Warp3D/GFXdrivers"
  259.                                "Copy CyberGraphX V4 driver"
  260.                 )
  261.                 (if (= #ppc 1)
  262.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4_PPC.library"
  263.                                    "libs:Warp3D/GFXdrivers"
  264.                                    "Copy CyberGraphX V4 driver (PPC version)"
  265.                     )
  266.                 )
  267.              )
  268.             )
  269.          )
  270.         )
  271.  
  272.         ; Try to find out the graphics card, assuming CVision3D
  273.         (set #graka 0)
  274.         (if (exists "devs:Monitors/CVision3D" (noreq))
  275.             (set #graka 0)
  276.         )
  277.         (if (exists "devs:Monitors/CVisionPPC" (noreq))
  278.             (set #graka 1)
  279.         )
  280.  
  281.         ; Ask for graphics card
  282.         (set #result
  283.             (askchoice
  284.                 (prompt "Please select the graphics device you want to use.")
  285.                 (help @askchoice-help)
  286.                 (choices
  287.                     "CyberVision64/3D"
  288.                     "CyberVisionPPC/BlizzardVisionPPC"
  289.                 )
  290.                 (default #graka)
  291.             )
  292.         )
  293.         (select #result
  294.             (
  295.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Virge.library")
  296.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Virge_PPC.library")
  297.             )
  298.             (
  299.                 (set #grdrv  "libs/Warp3D/HWdrivers/W3D_Permedia2.library")
  300.                 (set #grdrv2 "libs/Warp3D/HWdrivers/W3D_Permedia2_PPC.library")
  301.             )
  302.         )
  303.         (copylib
  304.             (prompt "Copying the hardware driver library")
  305.             (help @copylib-help)
  306.             (source #grdrv)
  307.             (dest "libs:Warp3D/HWdrivers")
  308.         )
  309.         (if (= #ppc 1)
  310.             (copylib
  311.                 (prompt "Copying the PPC hardware driver library")
  312.                 (help @copylib-help)
  313.                 (source #grdrv2)
  314.                 (dest "libs:Warp3D/HWdrivers")
  315.             )
  316.  
  317.         )
  318.         (if (= #result 1)
  319.          (
  320.             ; Take special steps for Permedia driver
  321.             (makedir "ENV:Warp3D")
  322.             (makedir "ENV:Warp3D/Permedia2")
  323.             (makedir "ENVARC:Warp3D")
  324.             (makedir "ENVARC:Warp3D/Permedia2")
  325.             (P_setenv "Warp3D/Permedia2/Dither" "on")
  326.             (set #result
  327.                 (askbool
  328.                     (prompt (cat "For the Permedia2 driver to work correctly, semaphore "
  329.                                  "locking is required. This is done by setting the environment "
  330.                                  "variable CyberGraphX/USESEMAPHORES to 1. See the documentation for more details. "
  331.                                  "Should the installer program do this now ?")
  332.                     )
  333.                     (help @askbool-help)
  334.                     (choices
  335.                         "Yes"
  336.                         "No"
  337.                     )
  338.                     (default 1)
  339.                 )
  340.             )
  341.             (if (= #result 1)
  342.                 (P_setenv "CyberGraphX/USESEMAPHORES" "1" )
  343.                 (message "Ok, but remember that you may run into troubles later!")
  344.             )
  345.  
  346.          )
  347.         )
  348.         ; Ask for demo installation
  349.         (set #result
  350.             (askbool
  351.                 (prompt "Do you want to install the demo?")
  352.                 (help @askbool-help)
  353.                 (choices
  354.                     "Yes"
  355.                     "No"
  356.                 )
  357.                 (default 1)
  358.             )
  359.         )
  360.         (if (= #result 1) (
  361.                 (set #demodest
  362.                     (askdir
  363.                         (prompt "Select a location to install the Demo. A Drawer \"W3DDemo\" will be created")
  364.                         (help @askdir-help)
  365.                         (newpath)
  366.                         (default "ram:")
  367.                     )
  368.                 )
  369.                 (if (NOT (exists #demodest))
  370.                     (makedir #demodest)
  371.                 )
  372.                 (copyfiles
  373.                     (source "demo/")
  374.                     (dest (tackon #demodest "W3DDemo"))
  375.                     (infos)
  376.                     (all)
  377.                     (optional "oknodelete" "force" "askuser")
  378.                 )
  379.             )
  380.         )
  381.         (set #result
  382.             (askbool
  383.                 (prompt "Do you want to Install the User's Guide?")
  384.                 (help @askbool-help)
  385.                 (choices
  386.                     "Yes"
  387.                     "No"
  388.                 )
  389.                 (default 1)
  390.             )
  391.         )
  392.         (if (= #result 1)
  393.             (
  394.                 (set #destdoc (askdir
  395.                         (prompt "Select the place to install the documentation. A drawer \"docs\" will be created.")
  396.                         (help @askdir-help)
  397.                         (newpath)
  398.                         (default "HELP:")
  399.                     )
  400.                 )
  401.                 (copyfiles
  402.                     (prompt "Copying documentation files")
  403.                     (help @copyfiles-help)
  404.                     (source "Docs")
  405.                     (infos)
  406.                     (all)
  407.                     (dest (tackon #destdoc "Docs"))
  408.                 )
  409.             )
  410.         )
  411.  
  412.         (exit "Warp3D has been installed on your system.\n"
  413.               "For more information on Warp3D, check out the 3d World website:\n"
  414.               "http://www.haage-partner.com/3dworld\n"
  415.               "You'll also find information on how to subscribe to the "
  416.               "3DWorld mailing list.\n\n"
  417.               "Have fun with Warp3D!")
  418.     )
  419.  
  420.     ; uninstall application
  421.  
  422.     (
  423.         ; --- insert your code below ---
  424.         (delete "libs:Warp3D.library" (optional "force"))
  425.         (delete "libs:Warp3DPPC.library" (optional "force"))
  426.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  427.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  428.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  429.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  430.         (delete "libs:Warp3D/" (optional "force"))
  431.         ; -- end of your code ---
  432.  
  433.         (message "Uninstallation completed. The demo and documentation must be deleted manually.")
  434.  
  435.         (exit (quiet))
  436.     )
  437. )
  438.  
  439.